package com.pulse.base.controller;

import com.alibaba.fastjson2.JSON;
import com.pulse.base.domain.Alarm;
import com.pulse.base.service.IAlarmService;
import com.pulse.common.core.controller.BaseController;
import com.pulse.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 报警记录Controller
 *
 * @author 陆帅
 * @date 2024-08-26
 */
@RestController
@RequestMapping("/base/alarm")
public class AlarmController extends BaseController {

    @Autowired
    private IAlarmService alarmService;

    /**
     * 查询报警记录列表
     */
    @PreAuthorize("@ss.hasPermi('base:alarm:list')")
    @GetMapping("/list")
    public TableDataInfo list(Alarm alarm)
    {
        startPage();
        List<Alarm> list = alarmService.selectAlarmList(alarm);
        return getDataTable(list);
    }
}
